package com.haixee.parkdemo.common.feign.auth;

import com.haixee.parkdemo.common.feign.auth.entity.DataScope;
import com.haixee.parkdemo.common.feign.auth.entity.FieldRule;
import com.haixee.parkdemo.common.feign.auth.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Map;

@FeignClient(value = "auth", path = "/rpc")
public interface AuthRPCService {

    @GetMapping("/data/scope")
    DataScope getDataScope(@RequestParam("aclId") Integer aclId);

    @GetMapping("/data/field/rule")
    Map<String, List<FieldRule>> getFieldRules(@RequestParam("aclId")Integer aclId, @RequestParam("fieldNameList") Collection<String> fieldNameList);


    @GetMapping("/user")
    User getUser(@RequestParam("uid") Integer uid);

    @GetMapping("/organize/under_tree")
    List<Integer> getUnderTree(@RequestParam("uid") Integer uid);
}
